VtFileSelectionDialog object_name [options]
Creates a FileSelection dialog which displays a list of directories and files for the current directory. The user can select a file from the list or type in the text area. It also allows the user to switch to other directories. The lists are automatically updated to show the list of files and directories in the current directory. Returns the widget name.
By default, File Selection dialogs have an OK, Cancel, Help and Filter button. The Filter button is used to switch directories. You can choose whether you want the OK, Cancel and Help buttons, by using the options -ok, -cancel, and -help (see VtMessageDialog). The Filter button is always present.
If the user chooses either the OK or Cancel button, the dialog is automatically popped down and destroyed. To override this default, -autoHide and -autoDestroy options can be used.
/etc/default/*
).
The following code produces a File Selection dialog box with the default labels redefined, and the Filter disabled.
set app [VtOpen "File Selection Dialog Demo"] VtFileSelectionDialog $app.demo \ -dirListLabel "Vegetables" \ -fileListLabel "Fruits" \ -hideFilter \ -selectionLabel "Choose your favorite food:" \ -selection "mushy peas" VtShowDialog $app.demo VtMainLoop
This code produces the following:
See also: